package com.netrust.cmsx.core.handler;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MethodExcuteTimeHandler implements MethodInterceptor{
    

	public Object invoke(MethodInvocation invocation) {
		
		System.out.println("---------------------start-------------------------");
		long a=System.currentTimeMillis();
		Object result = null;
		try {
			result = invocation.proceed();
		} catch (Throwable e) {
			// you can't do anything here
			// else if logger where run two times if you call MethodExceptionHandler
		}
		
		System.out.println("\r<br>执行耗时 : "+(System.currentTimeMillis()-a)/1000f+" 秒 ");
		System.out.println("---------------------end-------------------------");
		
		return result;
	}

}
